<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">

            <div class="ibox float-e-margins">
                <div class="ibox-title">

                    <h5> {$page_title}</h5>

                    <div class="ibox-tools"><a href="javascript:void(0);" class="btn btn-xs btn-default btn-help-detail"  data-type="cst_customer"> <i class="fa fa-question-circle"> 操作说明</i></a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form id="pagerForm" method="post" class="form-inline searchForm">
                            <div class="col-sm-12">
                                <div class="input-group text-left">
                                    <select data-placeholder="请选内容模型..." name="ads_id" class="chosen-select chosen-select-ads-id" style="width: 200px;">
                                        {volist name='ads_list' id='vo'}
                                        <option value="{$vo['id']}">{$vo['title']}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="input-group">
                                    <input type="text" name="keywords" placeholder="输入关键字搜索" class="form-control">
                                </div>
                                <div class="input-group">
                                    <span class="input-group-btn"> <button type="button" class="btn btn-primary ajaxSearchForm"><i class="fa fa-search"></i> 搜索</button></span>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-10">
                            <a class="btn btn-default btn-history"  data-title="模型添加" ><i class="fa fa-history"></i> 返回</a>
                            <lqf_link><a class="btn btn-info ajax-open"  data-url="{:url('AdsList/add',array('ads_id'=>$ads_id))}"><i class="fa fa-plus"></i> 添加</a></lqf_link>
                        </div>
                        <div class="col-sm-2 text-right">
                            <a href="javascript:void(0);" class="btn btn-default btn-outline btn-field-set" data-id="{$page_title|default=''}"> <i class="fa fa-columns"></i> 列</a>
                        </div>
                    </div>
                </div>
                <div class="ibox-content table-responsive">
                    <table class="table table-hover sorttable ajax-list-table" data-url="{:url('AdsList/show_json')}" width="100%">
                        <thead>
                        <tr>
                            <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                            <th width="30">ID</th>
                            <th width="100">标题</th>
                            <th width="100">链接</th>
                            <th width="100">浏览</th>
                            <th width="100">点击</th>
                            <th width="80">缩略图</th>
                            <th width="80" orderField="by_sort" class="sort-filed"><span>排序</span></th>
                            <th width="80">启用</th>
                            <th width="80" class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                        <tfoot class="ibox-content">
                        <tr>
                            <td colspan="7" align="center"></td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script id="tableListTpl" type="text/html">
    <% for(var i=0;i<data.length;i++) {
        visible='';
        if(data[i]['visible']=='1') visible='checked';
    %>
    <tr>
        <td><input name="field_ext_id" class="checkboxCtrlId" value="<%=data[i]['field_ext_id']%>" type="checkbox"></td>
        <td><%=data[i]['id']%></td>
        <td><%=data[i]['title']%></td>
        <td><%=data[i]['links']%></td>
        <td><%=data[i]['view']%></td>
        <td><%=data[i]['click']%></td>
        <td>
            <a class="fancybox" href="<%=data[i]['litpic']%>" title="图片1">
                <img src="<%=data[i]['litpic']%>" width="60">
            </a>
        </td>
        <td><input type="text" name="sort" value="<%=data[i]['sort']%>" class="form-control w50 ajax-sort" data-url="{:url('AdsList/set_sort',array('name'=>'sort'))}" data-id="<%=data[i]['id']%>" size="5"></td>
        <td>
            <input name="visible" class="ajax-checkbox" type="checkbox"   data-url="{:url('AdsList/set_visible',array('name'=>'visible'))}"  data-id="<%=data[i]['id']%>" <%=visible%> >
        </td>
        <td class="text-center">
                <lqf_link><a class="ajax-open" data-url="{:url('AdsList/edit')}"  data-ids="{'id':'<%=data[i]['id']%>'}" data-title="修改">修改</a></lqf_link>
                <lqf_link><a class="ajax-del confirm" data-url="{:url('AdsList/del')}" data-ids="{'id':'<%=data[i]['id']%>'}">删除</a></lqf_link>
        </td>
    </tr>
    <% } %>
</script>
<script type="text/javascript">
    $(document).ready(function () {
        turnPage(1);//页面加载时初始化分页
    });
</script>
<!-- Fancy box -->
<script src="__STATIC__/module/admin/js/plugins/fancybox/jquery.fancybox.js"></script>
<link href="__STATIC__/module/admin/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<script>
    $(document).ready(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    });
</script>
<script>
    $(".chosen-select-ads-id").val("{$ads_id}").trigger("chosen:updated");
</script>